package com.wang.wx.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wang.wx.mapper.EmailUserMapper;
import com.wang.wx.entity.EmailUser;
import com.wang.wx.service.EmailUserService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (EmailUser)表服务实现类
 *
 * @author makejava
 * @since 2024-08-07 15:03:41
 */
@Slf4j
@Service
public class EmailUserServiceImpl extends ServiceImpl<EmailUserMapper, EmailUser> implements EmailUserService {

    @Override
    public void createIndexes() {
        log.info("邮箱索引创建中");
        baseMapper.createIndexes();
        log.info("邮箱索引创建成功");
    }

    public void dropIndexes() {
        baseMapper.dropIndexes();
        log.info("邮箱索引删除成功");
    }

    @Override
    public List<EmailUser> getByPhone(String phone) {
        LambdaQueryWrapper<EmailUser> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(EmailUser::getMobile, phone);
        return this.list(wrapper);
    }
}

